<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{:L('INSTALL_WUKONG_CRM')}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="{:L('WUKONG_CRM')}">
<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/css/jquery-ui-1.10.0.custom.css" rel="stylesheet">
<style type="text/css">
  body {
	padding-top: 20px;
	padding-bottom: 20px;
	background-color: #f5f5f5;
  }

  .install {
	max-width: 600px;
	padding: 19px 29px 29px;
	margin: 0 auto 20px;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	   -moz-border-radius: 5px;
			border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
	   -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
			box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  .install input[type="text"],
  .install input[type="password"] {
	font-size: 16px;
	height: auto;
	padding: 7px 9px;
	margin:0;
  }
  .install h3 {
	border-bottom:1px solid #e5e5e5;
  }
  .wukong {
	margin-top:30px;
	padding-top:10px;
	border-top:1px solid #e5e5e5;		
  }
  .table td {border:0;}
  .table td label{border:0;line-height:34px;}
  .table td span{border:0;line-height:34px;color:#999999;}

</style>
<script type="text/javascript">
    var browserInfo = {browser:"", version: ""};
    var ua = navigator.userAgent.toLowerCase();
    if (window.ActiveXObject) {
        browserInfo.browser = "IE";
        browserInfo.version = ua.match(/msie ([\d.]+)/)[1];
        if(browserInfo.version <= 7){
            if(confirm("您的ie浏览器版本过低，建议使用chorme浏览器，\n点击【确定】转到下载页面")){}
            location.href = 'http://www.google.cn/intl/zh-CN/chrome/browser/';
        }
    }
</script>
<link href="__PUBLIC__/css/bootstrap-responsive.min.css" rel="stylesheet">
<link rel="shortcut icon" href="__PUBLIC__/ico/favicon.png">
</head>

<body>

<div class="container">
	<div class="install">
		<h3>{:L('WELCOME_INSTALL_WUKONG_CRM')}</h3>			
		<empty name="errors">			
		<volist name="warnings" id="warning">
		<div class="alert alert-warning">
			<button type="button" class="close" data-dismiss="alert">×</button>
			{$warning}
		</div>
		</volist>
		<form action="" method="post">	
			<table class="table table-hover" width="95%" border="0" cellspacing="1" cellpadding="0">
				<tr>
					<td width=80><label>{:L('THE_DATABASE_HOST')}</label></td>
					<td width=230><input type="text" name="DB_HOST" class="text-input" value="localhost" /></td>
					<td><span>{:L('GENERALLY_FOR_LOCALHOST')}</span></td>
				</tr>
				<tr>
					<td><label>{:L('PORT')}</label></td>
					<td><input type="text" name="DB_PORT" class="text-input" value="3306" /></td>
					<td><span>{:L('GENERALLY_FOR_3306')}</span></td>
				</tr>
				<tr>
					<td><label>{:L('THE_DATABASE_NAME')}</label></td>
					<td><input type="text" name="DB_NAME" class="text-input" placeholder="{:L('THE_DATABASE_NAME')}"/></td>
					<td><span>{:L('WUKONG_CRM_INSTALLATION_TO_WHICH_DATABASE')}</span></td>
				</tr>
				<tr>
					<td><label>{:L('THE_USER_NAME')}</label></td>
					<td><input type="text" name="DB_USER" class="text-input" placeholder="{:L('THE_USER_NAME')}"/></td>
					<td><span>{:L('MYSQL_NAME')}</span></td>
				</tr>
				<tr>
					<td><label>{:L('PASSWORD')}</label></td>
					<td><input type="text" name="DB_PWD" class="text-input" placeholder="{:L('PASSWORD')}"/></td>
					<td><span>{:L('MYSQL_NAME_PASSWORD')}</span></td>
				</tr>
				<tr>
					<td><label>{:L('THE_TABLE_PREFIX')}</label></td>
					<td><input type="text" name="DB_PREFIX" class="text-input" value="5k_" placeholder="5k_"/></td>
					<td><span></span></td>
				</tr>
				<tr>
					<td><label>{:L('SYS')}</label></td>
					<td><input type="text" name="name" class="text-input" placeholder="{:L('SYS')}"/></td>
					<td><span>{:L('WUKONG_CRM_SYS')}</span></td>
				</tr>
				<tr>
					<td><label>{:L('PASSWORD')}</label></td>
					<td><input type="text" name="password" class="text-input" placeholder="{:L('PASSWORD')}"/></td>
					<td><span>{:L('SYS_PASSWORD')}</span></td>
				</tr>
				<tr>
					<td></td>
					<td><button class="btn btn-primary" name="submit" type="submit" value="install">{:L('INSTALL')}</button></td>
					<td></td>
				</tr>
			</table>
		</form>
		<else />
		<volist name="errors" id="error">
		<div class="alert alert-error">
			<button type="button" class="close" data-dismiss="alert">×</button>
			{$error}
		</div>
		</volist>
		</empty>	  
		<div class="row-fluid wukong">
			<div class="span3"><img src="__PUBLIC__/img/logo_img.png" alt="{:L('WUKONG_CRM')}"/></div>
			<div class="span9">
				<p>{:L('WUKONG_CRM')} &copy; {:L('RUIQI_CULTURE')}</p>
				<p><small>
					<a href="http://www.5kcrm.com/" target="_blank">{:L('USE_THE_HELP')}</a>
					<span class="muted">&middot;</span>
					<a href="http://www.5kcrm.com/" target="_blank">{:L('TECHNICAL_SUPPORT')}</a>
					<span class="muted">&middot;</span>
					<a href="http://www.ccds24.com" target="_blank">{:L('CONTACT_US')}</a>
				</small></p>
			</div>
		</div>
	</div>
</div>
<div id="dialog-upgrade" class="hide" title="{:L('FOUND_THE_NEW_VERSION')}">
	<p>{:L('THE_CURRENT_VERSION')}: {:C("VERSION")} &nbsp; {:L('RELEASE_TIME')}: {:C("RELEASE")}</p>
	<p id="info"></p>
</div>
<script src="__PUBLIC__/js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/bootstrap.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/jquery-ui-1.10.0.custom.min.js" type="text/javascript"></script>

<script type="text/javascript">
$('#dialog-upgrade').dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	position :["center",100],
	buttons: { 
		"Cancel": function () {
			$(this).dialog("close");
		}
	},
});
$(function(){
	$.get("{:U('install/checkVersion')}", function(data){
		if (data.status) {
			$('#dialog-upgrade').dialog('open');
			$("#dialog-upgrade #info").html("<span style='color:red;'>" + data.info + "</span>");
		}
	});
});
</script>
</body>
</html>